﻿#include "FITKLoadConstraintSEABeam.h"
#include "FITKAcousticsAbstractSpectra.h"
#include "FITK_Kernel/FITKCore/FITKDataRepo.h"

namespace Acoustics
{
    FITKLoadConstraintSEABeam::FITKLoadConstraintSEABeam()
    {
        //构造
    }

    FITKLoadConstraintSEABeam::~FITKLoadConstraintSEABeam()
    {
        //析构
    }

    FITKAcousticsAbstractLoad::AcousticsLoadType FITKLoadConstraintSEABeam::getAcousticsLoadType()
    {
        //获取载荷类型
        return FITKAcousticsAbstractLoad::AcousticsLoadType::ConstraintSEABeam;
    }

    bool FITKLoadConstraintSEABeam::copy(FITKAbstractDataObject* obj)
    {
        //拷贝数据
        FITKLoadConstraintSEABeam* oldObj = dynamic_cast<FITKLoadConstraintSEABeam*>(obj);
        if (!oldObj) return false;
        _enabledState = oldObj->_enabledState;
        _notes = oldObj->_notes;
        _connectObjID = oldObj->_connectObjID;
        _flexureXSpectraID = oldObj->_flexureXSpectraID;
        _flexureYSpectraID = oldObj->_flexureYSpectraID;
        _extensionZSpectraID = oldObj->_extensionZSpectraID;
        _torsionZZSpectraID = oldObj->_torsionZZSpectraID;
        this->Core::FITKAbstractNDataObject::copy(obj);
        return true;
    }


    int FITKLoadConstraintSEABeam::getFlexureXSpectraID()
    {
        //获取弯曲波X频谱ID
        return _flexureXSpectraID;
    }

    FITKAcousticsAbstractSpectra * FITKLoadConstraintSEABeam::getFlexureXSpectra()
    {
        //获取弯曲波X频谱
        return FITKDATAREPO->getTDataByID<FITKAcousticsAbstractSpectra>(_flexureXSpectraID);
    }

    void FITKLoadConstraintSEABeam::setFlexureXSpectraID(int id)
    {
        //设置弯曲波X频谱ID
        _flexureXSpectraID = id;
    }

    int FITKLoadConstraintSEABeam::getFlexureYSpectraID()
    {
        //获取弯曲波Y频谱ID
        return _flexureYSpectraID;
    }

    FITKAcousticsAbstractSpectra * FITKLoadConstraintSEABeam::getFlexureYSpectra()
    {
        //获取弯曲波Y频谱
        return FITKDATAREPO->getTDataByID<FITKAcousticsAbstractSpectra>(_flexureYSpectraID);
    }

    void FITKLoadConstraintSEABeam::setFlexureYSpectraID(int id)
    {
        //设置弯曲波Y频谱ID
        _flexureYSpectraID = id;
    }

    int FITKLoadConstraintSEABeam::getExtensionZSpectraID()
    {
        //获取拉伸波Z频谱ID
        return _extensionZSpectraID;
    }

    FITKAcousticsAbstractSpectra * FITKLoadConstraintSEABeam::getExtensionZSpectra()
    {
        //获取拉伸波Z频谱
        return FITKDATAREPO->getTDataByID<FITKAcousticsAbstractSpectra>(_extensionZSpectraID);
    }

    void FITKLoadConstraintSEABeam::setExtensionZSpectraID(int id)
    {
        //设置伸波Z频谱ID
        _extensionZSpectraID = id;
    }

    int FITKLoadConstraintSEABeam::getTorsionZZSpectraID()
    {
        //获取扭转波ZZ频谱ID
        return _torsionZZSpectraID;
    }

    FITKAcousticsAbstractSpectra * FITKLoadConstraintSEABeam::getTorsionZZSpectra()
    {
        //获取扭转波ZZ频谱
        return FITKDATAREPO->getTDataByID<FITKAcousticsAbstractSpectra>(_torsionZZSpectraID);
    }

    void FITKLoadConstraintSEABeam::setTorsionZZSpectraID(int id)
    {
        //设置扭转波ZZ频谱ID
        _torsionZZSpectraID = id;
    }
}